﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;

namespace DBEngine.Tables
{
	internal class DBConnection
	{
		static private readonly string mConnectionString;
		static private SqlConnection mConnection;

        static DBConnection()
        {
            string dbfile = "d:\\users\\mohammad muhissen\\documents\\visual studio 2010\\Projects\\CVC Filing\\DBEngine\\CVC-Database.mdf";
                //new System.IO.FileInfo(System.Reflection.Assembly.GetExecutingAssembly().Location).DirectoryName + "\\CVC-Database.mdf";
            mConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=" + dbfile + ";Integrated Security=True;User Instance=True";
            
            try
            {  
                mConnection = new SqlConnection(mConnectionString);
                mConnection.Open();
            }
            catch (Exception EX){}

        }
	
		 internal static SqlCommand getCommand()
		 {
			 SqlCommand retval = null;
			 retval = mConnection.CreateCommand();
			 return retval;
		 }
	}
}
